#include <iostream>
#include <string>
using namespace std;

int main() {
    string str;
    getline(cin, str);
    int n, i;
    for ((str[0] != ' ') ? (i = n = 1) : (i = n = 0); i < str.size()-1; i++)    if (str[i] == ' ' && str[i+1] != ' ')   n++;
    cout << n;
    return 0;
}
